package models

import "gorm.io/gorm"

// 用户表
type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30);not null;comment:用户名称"`
	Password string `gorm:"type:varchar(32);not null;comment:用户密码"`
}

// 查找用户
func (u *User) GetInfoByUsername(username string) error {
	return DB.Where("username = ?", username).Limit(1).Find(&u).Error
}
